<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();%>
<!--头 -->
<style>
    .searchHot{
        margin-top: 5px;
    }

    .searchHot li:first-child{
        float: left;
    }
    .searchHot li~li{
        float: left;
        margin-left: 8px;
    }
    .searchHot li:nth-child(-n+3) a{
        color: red;
    }

</style>
<header>
    <article>
        <div class="mt-logo">
            <!--顶部导航条 -->
            <div class="am-container header">
                <ul class="message-l">
                    <div class="topMessage">
                        <c:if test="${user == null}">
                            <div class="menu-hd">
                                <a class="login" target="_top" class="h" href="<%=path%>/login.jsp">亲，请登录</a> |
                                <a href="<%=path%>/register.jsp" style="color: red;" target="_top">免费注册</a>
                            </div>
                        </c:if>
                        <c:if test="${user != null}">
                            <div class="menu-hd">
                                <span>
                                    欢迎用户：<a href="#">${user.userName}</a>
                                    <a class="logout"  style="color:red;" href="login.jsp">[退出]</a>
                                </span>
                                <span style="margin-left: 10px">当前等级：<span>${user.userLevel}</span></span>
                                <span style="margin-left: 10px">当前积分：<span>${user.userScore}</span></span>
                            </div>
                        </c:if>
                    </div>
                </ul>
                <ul class="message-r">
                    <div class="topMessage home">
                        <div class="menu-hd"><a href="<%=path%>/load" target="_top" class="h">商城首页</a></div>
                    </div>
                    <div class="topMessage my-shangcheng">
                        <c:if test="${user!=null}">
                            <div class="menu-hd MyShangcheng"><a href="<%=path%>/person/index.jsp" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
                        </c:if>
                        <c:if test="${user==null}">
                            <div class="menu-hd MyShangcheng"><a href="<%=path%>/login.jsp" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
                        </c:if>
                    </div>
                    <div class="topMessage mini-cart">
                        <c:if test="${user!=null}">
                            <div class="menu-hd"><a id="mc-menu-hd" href="<%=path%>/shopcart.jsp" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong style="color: red" id="J_MiniCartNum" class="h">${cartList.size()}</strong></a></div>
                        </c:if>
                        <c:if test="${user==null}">
                            <div class="menu-hd"><a id="mc-menu-hd" href="<%=path%>/login.jsp" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h"></strong></a></div>
                        </c:if>
                    </div>
                    <div class="topMessage favorite">
                        <c:if test="${user!=null}">
                            <div class="menu-hd"><a href="<%=path%>/like?type=getAll" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
                        </c:if>
                        <c:if test="${user==null}">
                            <div class="menu-hd"><a href="<%=path%>/login.jsp" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
                        </c:if>
                    </div>
                </ul>
            </div>

            <!--悬浮搜索框-->

            <div class="nav white">
                <div class="logoBig">
                    <li><a href="<%=path%>/load"><img src="<%=path%>/images/logobig.png" /></a></li>
                </div>

                <div class="search-bar pr">
                    <a name="index_none_header_sysc" href="#"></a>
                    <form action="search" method="post">
                        <c:if test="${key==null}">
                            <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
                        </c:if>
                        <c:if test="${key!=null}">
                            <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="${key}" autocomplete="off">
                        </c:if>
                        <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
                    </form>
                    <c:if test="${historyTop5.size()!=0}">
                        <c:forEach items="${historyTop5}" var="historyTop5">
                            <a class="Searchkey" href="search?index_none_header_sysc=${historyTop5.searchKey}">${historyTop5.searchKey}</a>
                        </c:forEach>
                    </c:if>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        </div>
    </article>
</header>
<script src="<%=path%>/js/jquery.js"></script>
<script type="text/javascript">
    $(".Searchkey:lt(3)").css("color","red");
</script>
